function fmt(x) {
	return (x <= 9 ? '0' + x : x);
}

function dateToYMD(date) {
	var y = date.getFullYear();
	var m = date.getMonth() + 1;
	var d = date.getDate();
	var hh = date.getHours();
	var mm = date.getMinutes();
	var ss = date.getSeconds();

	return fmt(d) + "." + fmt(m) + "." + y + ", " + fmt(hh) + ":" + fmt(mm)
			+ ":" + fmt(ss);
}

function show() {
	document.getElementById("timer").innerHTML = dateToYMD(new Date());
	setTimeout("show()", 1000);
}
show();